home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Multimedia / FL Studio 4.5.2 / FLStudio452_Install.exe / Help / FD.chm / html / _casecommon2.js < prev    next >
Encoding:
Text File  |  2003-11-05  |  16.5 KB  |  298 lines

  1. // shared decoding and rendering routines
  2.  
  3. // global objects
  4. params=new Array();
  5. userData=new Array();
  6.  
  7. // --------------------------------------
  8. // registration information
  9. // --------------------------------------
  10. regInfo=[];
  11. regInfo[0]={code:31020,name:'FL Studio Producer Edition',registered:false,needed:false}; // FL
  12. regInfo[1]={code:31010,name:'FL Studio FruityLoops Edition',registered:false,needed:false};
  13. regInfo[2]={code:31000,name:'FL Studio Express Edition',registered:false,needed:false};
  14. regInfo[3]={code:37040,name:'Sytrus',registered:false,needed:false, isPlug:true};    
  15. regInfo[4]={code:37030,name:'Fruity Soundfont Player',registered:false,needed:false, isPlug:true}; // Plugins
  16. regInfo[5]={code:37020,name:'Fruity DX10',registered:false,needed:false, isPlug:true};
  17. regInfo[6]={code:33300,name:'Wasp',registered:false,needed:false, isPlug:true};
  18. regInfo[7]={code:33110,name:'SimSynth',registered:false,needed:false, isPlug:true};
  19. regInfo[8]={code:33000,name:'Fruity DrumSynth Live',registered:false,needed:false, isPlug:true};
  20. regInfo[9]={code:33400,name:'DreamStation DXi',registered:false,needed:false, isPlug:true};
  21. regInfo[10]={code:22100,name:'SimSynth (standalone)',registered:false,needed:false, isPlug:false};
  22. regInfo[11]={code:22250,name:'EZ-Editor',registered:false,needed:false, isPlug:false};
  23. regInfo[12]={code:22220,name:'BeatSlicer',registered:false,needed:false, isPlug:false};
  24. //    {code:37021,name:'DX10 VSTi/DXi',registered:false,needed:false, isPlug:true};  
  25. //    {code:37310,name:'WASP VSTi/DXi',registered:false,needed:false, isPlug:true}; 
  26. //    {code:37110,name:'SimSynth Live VSTi/DXi',registered:false,needed:false, isPlug:true};  
  27. //    {code:33400,name:'DreamStation DXi',registered:false,needed:false, isPlug:true},        
  28. // object with product text info (matches the index from the previous one)
  29. productText=[];
  30. // **** PRODUCER **** <<START>>
  31. productText[0]='<div align="center"><img src="img_glob/_fllogo_producer.gif" width="180" height="83"></div>';
  32. productText[0]+='<span class="fl-emph">FL Studio Producer Edition contains: </span>';
  33. productText[0]+='<ul><li class="fl-text">All <span class="fl-emph">Fruityloops Edition</span> features and…</li>';
  34. productText[0]+='<li class="fl-text"> New Mixer Window (64 channels, track rerouting, ASIO track recording, integrated EQ and more).</li>';
  35. productText[0]+='<li class="fl-text"> Audio tracks with waveform preview & support for cue points.</li>';
  36. productText[0]+='<li class="fl-text"> Direct-to-disk recording & offline rendering of mixer tracks. </li>';
  37. productText[0]+='<li class="fl-text"> Integrated Wave Editor.</li>';
  38. productText[0]+='<li class="fl-text"> Life Time Free Updates to this edition.</li>';
  39. // **** PRODUCER **** <<END>>
  40. // **** FRUITYLOOPS **** <<START>>
  41. productText[1]='<div align="center"><img src="img_glob/_fllogo_fl.gif" width="180" height="83"></div>';
  42. productText[1]+='<span class="fl-emph">FL Studio Fruityloops Edition contains:</span>';
  43. productText[1]+='<ul><li class="fl-text">All <span class="fl-emph">Express Edition</span> features and…</li>';
  44. productText[1]+='<li class="fl-text">Piano roll allowing chords.</li>';
  45. productText[1]+='<li class="fl-text">Full automation of all wheels.</li>';
  46. productText[1]+='<li class="fl-text">ASIO support (allowing 2ms latency!).</li>';
  47. productText[1]+='<li class="fl-text">Internal controllers.</li>';
  48. productText[1]+='<li class="fl-text">Can be used as VSTi client in hosts like Cubase, Sonar, Logic, Orion, ...</li>';
  49. productText[1]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  50. // **** FRUITYLOOPS **** <<END>>
  51. // **** EXPRESS **** <<START>>
  52. productText[2]='<div align="center"><img src="img_glob/_fllogo_express.gif" width="180" height="83"></div>';
  53. productText[2]+='<span class="fl-emph">FL Studio Express Edition contains:</span>';
  54. productText[2]+='<ul><li class="fl-text">External generators.</li>';
  55. productText[2]+='<li class="fl-text">16Bit 44KHz stereo.</li>';
  56. productText[2]+='<li class="fl-text">External midi control</li>';
  57. productText[2]+='<li class="fl-text">Unlimited number of channels</li>';
  58. productText[2]+='<li class="fl-text">4 to 64 notes in a pattern sequencer.</li>';
  59. productText[2]+='<li class="fl-text">Integrated TS-404 bassline.</li>';
  60. productText[2]+='<li class="fl-text">Support for VSTi & DXi.</li>';
  61. productText[2]+='<li class="fl-text">Export to wav, MP3 & MIDI.</li>';
  62. productText[2]+='<li class="fl-text">Playlist.</li>';
  63. productText[2]+='<li class="fl-text">Piano keyboard.</li>';
  64. productText[2]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  65. // **** EXPRESS **** <<END>>
  66. productText[3]='Sytrus is a versatile synthesizer combining Frequency Modulation (FM), Ring Modulation (RM), plucked string modeling and subtracting synthesis, and featuring a powerful envelope editor.<br>The synth includes a powerful editable unison mode and a comprehensive effects section.';
  67. productText[4]='Fruity Soundfont Player is an FL Studio add-on that gives you the power to load, play and render soundfonts (.sf2 files).';
  68. productText[5]='This DX10 FM synth is an FL Studio add-on that recreates the classic FM sound by using a harmonically rich modulating oscillator. Intuitive interface!';
  69. productText[6]='The WASP is the FL Studio generator version of the WASP, a complex subtractor using 2 oscillators. You get both the Fruity as the VSTi version.';
  70. productText[7]='SimSynth Live is the FL Studio generator version of SimSynth. This is a <b>realtime</b> version of the standalone version of SimSynth that can be run INSIDE FL Studio.';
  71. productText[8]='Gives you the power of Live drums in your FL Studio productions. Tweak your drums until they are just perfect!';
  72. productText[9]='Dreamstation DXi is a versatile DirectX instrument creating "analog synth" quality sounds that works inside all DXi compatible hosts like FL Studio and Sonar.';
  73. productText[10]='SimSynth Standalone is the original version of SimSynth. It has more advanced settings and can produce a wider variety of sounds but can not run in FL Studio. However, FL Studio can use its presets and riffs as regular samples!';
  74. productText[11]='EZ Editor is the ideal companion for all your sample handling. Recording of WAV, set loop points, create custom shapes (formula editor), extract SoundFonts, ... ';
  75. productText[12]='BeatSlicer is an application that allows you to "slice" drumbreaks or other loops into its individual parts, rearrange them and use them inside FL Studio.';
  76. // --------------------------------------
  77.  
  78. // --------------------------------------
  79. // this section contains routines to decode
  80. // the parameters
  81. // --------------------------------------
  82. function arrBase16_dec() { // decode info an array
  83.     var source=((paramsSource).slice(1)).toUpperCase(); // dump "G" at start & capitalize
  84.     var i=0,j=0;
  85.     var base16='0123456789ABCDEF';
  86.     var buffer=new Array();
  87.     buffer=source.split('G');
  88.     // init  (in case FL doesn't pass anything)
  89.     params[0]='';    params[1]='';    params[2]='';    params[3]='';    params[4]='';    
  90.     // parse
  91.     for (i=0;i<buffer.length;i++) {
  92.         params[i]='';
  93.         for (j=0;j<buffer[i].length;j+=2) {
  94.              params[i]+=String.fromCharCode(16*base16.indexOf(buffer[i].charAt(j))+base16.indexOf(buffer[i].charAt(j+1)));
  95.         }
  96.     }
  97. }
  98. function user_dec() { // decodes the user data elements
  99.     // init  (in case FL doesn't pass anything)
  100.     userData[0]='';userData[1]='';userData[2]='';userData[3]='';
  101.     // parse
  102.     userData[0]=params[1].substring(0,params[1].indexOf(':'));
  103.     userData[1]=params[1].substring(params[1].indexOf(':')+1,params[1].lastIndexOf(':'));
  104.     userData[2]=params[1].substring(params[1].indexOf('[')+1,params[1].indexOf(']'));
  105.     userData[3]=params[1].substring(params[1].indexOf('|')+1,params[1].lastIndexOf('|')).slice('|');
  106.     // DEBUG
  107.     //userData[3]='[]';
  108.     // END DEBUG    
  109. }
  110. function scanRegInfo() { // scans ID-s and pluglist and updates regInfo
  111.     var i,j;
  112.     // scan codes
  113.     var codes=userData[3].split('|');    
  114.     for (i=0;i<codes.length;i++) {
  115.         // detect is it Creative version
  116.         if (codes[i]=='21020') {
  117.             isCreative=true;
  118.             // patch the regInfo/productText (temporal fix)
  119.             regInfo[2].name='FL Studio Creative Edition';
  120.             productText[1]='<div align="center"><img src="img_glob/_fllogo_fl.gif" width="180" height="83"></div>';
  121.             productText[1]+='<span class="fl-emph">FL Studio Fruityloops Edition contains:</span>';
  122.             productText[1]+='<ul><li class="fl-text">All <span class="fl-emph">Creative Edition</span> features and…</li>';
  123.             productText[1]+='<li class="fl-text">Piano roll allowing chords.</li>';
  124.             productText[1]+='<li class="fl-text">Full automation of all wheels.</li>';
  125.             productText[1]+='<li class="fl-text">ASIO support (allowing 2ms latency!).</li>';
  126.             productText[1]+='<li class="fl-text">Internal controllers.</li>';
  127.             productText[1]+='<li class="fl-text">Can be used as VSTi client in hosts like Cubase, Sonar, Logic, Orion, ...</li>';
  128.             productText[1]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  129.         }    
  130.         for (j=0;j<regInfo.length;j++) {
  131.             if (regInfo[j].code==Number(codes[i])) {
  132.                 regInfo[j].registered=true;
  133.             }
  134.         }
  135.     }
  136.     // scan pluglist
  137.     var pluglist=params[4].split(':');
  138.     for (i=0;i<pluglist.length;i++) {
  139.         for (j=0;j<regInfo.length;j++) {
  140.             if (regInfo[j].name.toUpperCase()==pluglist[i].toUpperCase()) {
  141.                 regInfo[j].needed=true;
  142.             }
  143.         }
  144.     }    
  145. }
  146. // --------------------------------------
  147.  
  148. // --------------------------------------
  149. // to pass parameters as an URL
  150. // --------------------------------------
  151. function escape2(source) {
  152.     var i,c;
  153.     var result='';
  154.     for (i=0;i<source.length;i++) {
  155.         c=source.charAt(i);
  156.         switch (true) {
  157.              case (c==' '):
  158.                 result+='+'; break;
  159.             case ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='.' || c=='/' || c=='\\'):
  160.                 result+=c; break;
  161.             default:
  162.                 result+='%'+(Number(source.charCodeAt(i)).toString(16)).toUpperCase();
  163.         }    
  164.   }
  165.     return result;
  166. }
  167. // --------------------------------------
  168.  
  169. // --------------------------------------
  170. // procedures for managing the expanding tables
  171. // --------------------------------------
  172. function switchDTable(name) { // switches the body DIV of the table
  173.     var tableBody=eval(name+'body');
  174.   var tableGadget=eval(name+'gadget');
  175.     if (tableBody.style.display=='none' || tableBody.style.display=='') {
  176.         tableBody.style.display='block';
  177.         tableGadget.src='img_glob/_dyntbl_topleft2.gif';
  178.     }    else {
  179.         tableBody.style.display='none';
  180.         tableGadget.src='img_glob/_dyntbl_topleft1.gif';
  181.     }    
  182. }
  183. var countDTable=1; // this variable is used to give tables unique names (next function)
  184. function makeDTable(title, contents, isOpened) { // renders a dynamic table
  185.     // header
  186.     document.write('<p><table class="table-header" onClick="switchDTable(\''); // >>> table header
  187.     document.write('table'+(++countDTable)); // increase counter & write caller name
  188.     document.write('\');" width="100%" border="0" cellspacing="0" cellpadding="0">');
  189.     document.write('<tr>');
  190.     document.write('<td width="22" height="22" align="left" background="img_glob/_dyntbl_top.gif">'); // >>> top left edge
  191.     if (isOpened) document.write('<img src="img_glob/_dyntbl_topleft2.gif" name="');
  192.     else document.write('<img src="img_glob/_dyntbl_topleft1.gif" name="');
  193.     document.write('table'+countDTable+'gadget'); // write image name
  194.     document.write('" width="22" height="22"></td>'); 
  195.     document.write('<td height="22" align="left" background="img_glob/_dyntbl_top.gif">'); // >>> top (title)
  196.     document.write('<nobr><span class="table-title">'+title+'</span> <span class="table-titlenote">(click here for more information)</span></nobr></td>'); // write title
  197.     document.write('<td width="22" height="22" align="right" background="img_glob/_dyntbl_top.gif"><img src="img_glob/_dyntbl_topright.gif" width="23" height="22"></td></tr></table>'); // >>> top right edge
  198.     if (isOpened) document.write('<div class="table-body" style="display: block" id="table'+countDTable+'body">'+contents+'</div>'); // >>> write table body name (opened) & contents
  199.     else document.write('<div class="table-body" style="display: none" id="table'+countDTable+'body">'+contents+'</div>'); // >>> write table body name (closed) & contents    
  200.     document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>'); // >>> bottom section
  201.     document.write('<td width="22" height="22" align="left" background="img_glob/_dyntbl_bottom.gif"><img src="img_glob/_dyntbl_bottomleft.gif" width="23" height="22"></td>'); // >>> bottom left edge
  202.     document.write('<td height="22" background="img_glob/_dyntbl_bottom.gif"> </td>'); // >>> bottom side
  203.     document.write('<td width="22" height="22" align="right" background="img_glob/_dyntbl_bottom.gif"><img src="img_glob/_dyntbl_bottomright.gif" width="23" height="22"></td>'); // >>> bottom right edge
  204.     document.write('</tr></table></p>');
  205. }
  206. function makePlugDTable(i) { // makes a plugin/add-on dynamic table (based on the regInfo index)
  207.   var contents='';
  208.     contents+='<table border="0" cellspacing="0" cellpadding="0"><tr>';
  209.     contents+='<td><img src="img_glob/Register '+regInfo[i].name+'.gif" width="130" height="130" align="left">';
  210.     contents+=productText[i]+'</td></tr></table>';
  211.     contents+='<br><br>Click '+returnBuyLink(regInfo[i].code)+'here</a> to order.';
  212.     if (regInfo[i].name=='SimSynth') {
  213.         makeDTable('SimSynth Live',contents, false);
  214.     } else {
  215.         makeDTable(regInfo[i].name,contents, false);
  216.     }
  217.         
  218. }
  219. function makeFLDTable(i) { // makes a "FL info" dynamic table (based on the regInfo index)
  220.     var titleEnd; // modifies the table title
  221.   var contents='<table border="0" cellpadding="5" cellspacing="5">';
  222.     contents+='<tr valign="top">';
  223.     var cellSpan; // how many percent spans each table cell
  224.     if (i==-1) cellSpan='33%';
  225.     if (i==2) cellSpan='50%';
  226.     if (i==1) cellSpan='100%';
  227.  
  228.     if (i==0) {    // if all upgrades are purchased, just write "no upgrades.."
  229.         document.write('<p>No FL-Studio upgrades are available for your release.</p>');
  230.     } else { // write the tables..
  231.         if (i==-1) {
  232.             titleEnd="purchases";
  233.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  234.             contents+=productText[2];
  235.             if (i==-1) {
  236.                 contents+='<p>'+returnBuyLink(31000)+'Click here to buy Express Edition ($49).</a></p>';
  237.             }                
  238.             contents+='</td>';
  239.             
  240.         } else {
  241.             titleEnd="upgrades";
  242.         }
  243.         if (i==2 || i==-1) {
  244.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  245.             contents+=productText[1];
  246.             if (i==-1) {    
  247.                 contents+='<p>'+returnBuyLink(31010)+'Click here to buy FruityLoops Edition ($99).</a></p>';
  248.             }        
  249.             if (i==2) {
  250.                 if (!isCreative) contents+='<p>'+returnBuyLink(31050)+'Click here to upgrade to FruityLoops Edition ($59).</a></p>';
  251.                 else contents+='<p>'+returnBuyLink(31075)+'Click here to upgrade to FruityLoops Edition ($69).</a></p>';
  252.             }                
  253.             contents+='</td>';
  254.         }
  255.         if (i>=1 || i==-1) {
  256.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  257.             contents+=productText[0];
  258.             if (i==-1) {    
  259.                 contents+='<p>'+returnBuyLink(31020)+'Click here to buy Producer Edition ($149).</a></p>';    
  260.             }            
  261.             if (i==1) {
  262.                 contents+='<p>'+returnBuyLink(31040)+'Click here to upgrade to Producer Edition ($59).</a></p>';
  263.             }    
  264.             if (i==2) {
  265.                 if (!isCreative) contents+='<p>'+returnBuyLink(31051)+'Click here to upgrade to Producer Edition ($109).</p>';
  266.                 else contents+='<p>'+returnBuyLink(31076)+'Click here to upgrade to Producer Edition ($119).</p>';
  267.             }                    
  268.             contents+='</td>';
  269.         }            
  270.         contents+='</tr></table>';
  271.         makeDTable('Available FL-Studio '+titleEnd,contents, true);
  272.     }
  273. }
  274. // --------------------------------------
  275.  
  276. // --------------------------------------
  277. // procedures for writing the links
  278. // --------------------------------------
  279. function returnLink(action, productID) { // returns link for the product/action specified
  280.     var linkContent='';
  281.     linkContent+='<a href="http://flredirect.e-officedirect.com/flredirect.exe?forumname=flstudio';
  282.     linkContent+='&action='+action;
  283.     linkContent+='&username='+escape2(userData[0]);
  284.     // linkContent+='&applicationID='+escape2(params[2])+'; appID not needed
  285.     if (action=='buy') linkContent+='&P_code='+productID; // product code only in buy/upgrade links
  286.     linkContent+='" target="_blank" class="link-common">';
  287.     return linkContent;
  288. }
  289. function returnSupportLink() { // support request link (reg problems)    
  290.     return returnLink('supportrequest',0);
  291. }
  292. function returnRegisterLink() { // code request/register link    
  293.     return returnLink('register',0);
  294. }
  295. function returnBuyLink(productID) { // product buy/upgrade    
  296.     return returnLink('buy',productID);
  297. }
  298. // --------------------------------------